﻿using MediatR;
using SheepStorage.API.Application.Command.SheepMomPergnantCommand;
using SheepStorage.API.Baseclass;
using SheepStorage.Domain.Entity;
using SheepStorage.Service.Interface;

namespace SheepStorage.API.Application.CommandHandlers.SheepMomPergnantHandler
{
    public class SheepMomPergnantDelCommandHandler : IRequestHandler<SheepMomPergnantDelCommand, Results<int>>
    {
        private readonly ISheepMomPergnantService _sheepMomPergnantService;
        public SheepMomPergnantDelCommandHandler(ISheepMomPergnantService sheepMomPergnantService)
        {
            _sheepMomPergnantService = sheepMomPergnantService;
        }
        public async Task<Results<int>> Handle(SheepMomPergnantDelCommand request, CancellationToken cancellationToken)
        {
            return Results<int>.DataResult(await _sheepMomPergnantService.DelSheepMomPergnant(request.MomPergnantId));
        }
    }
}
